package com.tian.util.view

import android.content.res.Resources
import android.util.TypedValue

/**
 * @author tiansongtao, Email:tiansongtao@up366.com
 * @date 2022/12/12 13:24
 */
object DisplayUtil {

    fun dpToPx(value: Float): Float {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, value, Resources.getSystem().displayMetrics)
    }

    fun spToPx(value: Float): Float {
        return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP, value, Resources.getSystem().displayMetrics)
    }
}